{%extends "issue_base.html"%}
{%block body%}

<script language="JavaScript" type="text/javascript"><!--
document.onkeydown = M_keyDown;
{%if user%}
logged_in = true;
{%else%}
logged_in = false;
login_warned = false;
{%endif%}
// -->
</script>

<div style="float: left;">
  <h2 style="margin-bottom: 0em; margin-top: 0em;">Unified Diff: {{patch.filename}}</h2>
  {%ifnotequal patch.nav_type "patch"%}
    <span style="color:red">Side-by-side diff isn't available for this file because of its large size.</span>
  {%endifnotequal%}
  <div style="margin-top: .2em;">{%include "issue_star.html"%}
    <b>Issue <a href="{%url codereview.views.show issue.key.id%}" onmouseover="M_showPopUp(this, 'popup-issue');" id="upCL">{{issue.key.id}}</a>:</b>
  {{issue.subject}} {%if issue.closed %} (Closed) {%endif%}
  {%if issue.base%}<span class="extra">Base URL: {{issue.base}}</span>{%endif%}</div>
  <div style="margin-top: .4em;">
    <b>Patch Set: {%if patchset.message%}{{patchset.message}}{%endif%}</b>
    <span class="extra">
    Created {{patchset.created|timesince}} ago
    {%if patchset.url%},
    Downloaded from: <a href="{{patchset.url}}">{{patchset.url}}</a>
    {%endif%}
    </span>
  </div>
  <div style="margin-top: .4em;" class="help">
    Use n/p to move between diff chunks;
    N/P to move between comments.
    {%if user%}
    <span style="color:red">Draft comments are only viewable by you.</span>
    {%endif%}
  </div>
</div>
{%if column_width and context and tab_spaces%}
  <input type="hidden" id="id_context" value="{{context}}" />
  <input type="hidden" id="id_column_width" value="{{column_width}}" />
  <input type="hidden" id="id_tab_spaces" value="{{tab_spaces}}" />
{%endif%}
<div style="float: right; color: #333333; background-color: #eeeeec; border: 1px solid lightgray; -moz-border-radius: 5px 5px 5px 5px; padding: 5px;">
  <div>
    Jump to: <select onchange="M_jumpToPatch(this, {{issue.key.id}}, {{patchset.key.id}}, true);">
      {% for jump_patch in patchset.patches_cache %}
        <option value="{{jump_patch.key.id}}"
         {%ifequal jump_patch.key.id patch.key.id%} selected="selected"{%endifequal%}>{{jump_patch.filename}}</option>
      {% endfor %}
    </select>
  </div>
  {%if not patch.no_base_file%}
  <div style="margin-top: 5px;">
    <a href="{%url codereview.views.diff issue.key.id,patchset.key.id,patch.filename%}{%urlappend_view_settings%}">
    View side-by-side diff with in-line comments</a>
  </div>
  {%endif%}
  <div style="margin-top: 5px;">
    <a href="{%url codereview.views.download_patch issue.key.id,patchset.key.id,patch.key.id%}"
       title="Download patch for {{patch.filename}}">
      Download patch
    </a>
  </div>
</div>
<div style="clear: both;"></div>

<div class="code" style="margin-top: 1.3em; display: table; margin-left: auto; margin-right: auto;">

<div class="codenav">
{%include "file_navigation.html"%} <br/>
<a href="javascript:M_expandAllInlineComments()">Expand Comments</a> ('e')
|
<a href="javascript:M_collapseAllInlineComments()">Collapse Comments</a> ('c')
|
<a name="show-all-inline"
   style="display:none"
   href="javascript:M_showAllInlineComments()">Show Comments</a>
<a name="hide-all-inline"
   href="javascript:M_hideAllInlineComments()">Hide Comments</a> ('s')
</div>

<div style="position:relative" id="table-top">

{%if patch.is_binary%}
<img src="{%url codereview.views.image issue.key.id,patchset.key.id,patch.key.id,1%}" />
{%else%}
<span id="hook-sel" style="display:none;"></span>

<table style="padding: 5px;" cellpadding="0" cellspacing="0" id="thecode">
{%for row in rows%}{{row|safe}}{%endfor%}
</table>
{%endif%}

</div>
<div class="codenav">
{%include "file_navigation.html"%}
</div>
</div>

<script language="JavaScript" type="text/javascript"><!--
var old_snapshot = "old";
var new_snapshot = "new";
var intraLineDiff = new M_IntraLineDiff();
var hookState = new M_HookState(window);
hookState.updateHooks();


// -->
</script>

{%endblock%}
